<template>
  <div>
    <el-upload
    :value="value"
    @change="fn"

      class="avatar-uploader"
      action=""
      name="image"
      :show-file-list="false"
      :on-success="handleSuccess"
    >
      <!--预览图片的地址设置-->
      <img v-if="uploadImageUrl" :src="uploadImageUrl" class="avatar" />
      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
    </el-upload>
  </div>
</template>

<script>
export default {
  props: ['value'],
  data() {
    return {
      // 上传图片的地址
      uploadImageUrl: null
    }
  },
  methods: {
    fn() {
      this.$emit('input', this.uploadImageUrl)
    },
    handleSuccess() {

    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
</style>
